#pragma once


#include "DistortionModel.h" 
#include "maya/MSelectionList.h"
#include "Options.h"
#include <vector>
#include <list>
#include "VertexBase.h"
#include <algorithm>
#include <set>
#include "Path.h"
using namespace std;

class SeamCutter
{
public:
	SeamCutter(DistortionModel* dist, double D, Options* opts);		
	~SeamCutter(void);
	vector<int> getSeamVertices();
	vector<int> getSeamEdges();

private:
	vector<VertexBase*> getTerminalVertices();
	vector<vector<Path*>> makeConnectedGraph(vector<VertexBase*> terminalVerts);
	void prims(list<Path*> sortedEdges, int size, vector<Path*>& mst);
	void findpath (Path* path, vector<vector<double>> minDists, vector<vector<int>> next);

	vector<vector<int>> next;
	vector<vector<double>> minDists;

	vector<int> seamEdges;
	vector<int> seamVerts;	

	DistortionModel* dist;
	double D;
	double totalDistortion;
};
